echo 正在进入Linux常用工具菜单
echo -e "\033[31m --------------请选择Linux常用工具-----------------\033[0m"
echo -e "\033[31m -1 进入VSFTP工具：安装或添加用户，若不存在服务则安装，存在则添加用户-\033[0m"
echo -e "\033[31m -2 进入MySQL工具-必须先安装MySQL或者（mariadb）-\033[0m"
echo -e "\033[31m -3 进入Git工具箱--小白式配置git服务-\033[0m"
echo -e "\033[31m -4 一键配置SSR服务[VPN工作网络]-\033[0m"
read modeLinux
if [ $modeLinux == 1 ];then
	rpmd=$(rpm -qa | grep vsftpd)
	if [ -z "$rpmd" ];then
		sh configure/tools/ftp-install.sh
	else
		echo -e "\033[31m --------------你已安装FTP服务-----------------\033[0m"
	fi
 
	echo -e "\033[1m —————--------是否需要添加并配置用户信息,输入 y 或者  n   回车====—————\033[0m"
	read xjyh
	while [ $xjyh == y ];do
	if [ $xjyh == y ];then
		sh configure/tools/ftp-adduser.sh
		echo 是否继续添加[y/n]
		read xjyh
	else
		echo 跳出用户配置
	fi
	break;
	done
	chmod 755 -R /var/www/html/
	systemctl restart vsftpd
	systemctl enable vsftpd
	systemctl stop firewalld
	systemctl disable firewalld
	echo 配置完成，本脚本FTP默认配置为可上传下载权限
elif [ $modeLinux == 2 ];then
	echo -e "\033[31m -2 正在进入数据库工具并检测是否已安装数据库服务-\033[0m"
	rpmm=$(rpm -qa | grep mariadb)
	if [ -z "$rpmm" ];then
		echo -e "\033[31m --------------你未安装数据库服务-----------------\033[0m"
	else
		echo -e "\033[31m --------------你已安装数据库服务，请选择工具-----------------\033[0m"
		echo -e "\033[31m -----------1：强制修改数据库密码(root用户）---------\033[0m"
		echo -e "\033[31m -----------2：正规修改数据库密码(root用户）-需要知道数据库root用户密码---------\033[0m"
		echo -e "\033[31m -----------3：添加新的数据库用户---------\033[0m"
		read mysql
		if [ $mysql == 1];then
			echo configure/install/db/mariadb-setpass.sh
		elif [ $mysql == 2 ];then
			sh configure/install/db/mariadb-updatepass.sh
		elif [ $mysql == 3 ];then
			sh configure/install/db/mariadb-newuser.sh
		else
			echo 选择错误
		fi	
	fi
	rpmm=$(rpm -qa | grep MySQL)
	if [ -z "$rpmm" ]
	then
                echo -e "\033[31m --------------你未安装数据库服务-----------------\033[0m"
        else
                echo -e "\033[31m --------------你已安装数据库服务，请选择工具-----------------\033[0m"
                echo -e "\033[31m -----------1：强制修改数据库密码(root用户）---------\033[0m"
                echo -e "\033[31m -----------2：正规修改数据库密码(root用户）-需要知道数据库root用户密码---------\033[0m"
                echo -e "\033[31m -----------3：添加新的数据库用户---------\033[0m"
		read mysql
		if [ $mysql == 1];then
			echo configure/install/db/mysql-setpass.sh
		elif [ $mysql == 2 ];then
			sh configure/install/db/mysql-updatepass.sh
		elif [ $mysql == 3 ];then
			sh configure/install/db/mysql-newuser.sh
		else
			echo 选择错误
		fi
	fi
elif [ $modeLinux == 3 ];then
	sh configure/git/set-git.sh
elif [ $modeLinux == 4 ];then
	sh configure/tools/ssr-vpn.sh
else
	echo -e "\033[1m 选择错误，安装终止\033[31m"
fi	
